<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<body>
	<style type="text/css">
#studentHome {
	padding: 15px;
	background: #fff;
	border-radius: 10px;
}

.layui-inline {
	width: 30%;
}

.layui-input-block {
	margin-left: 135px;
}

.layui-form-label {
	width: 100px;
}
</style>
	<div id="studentHome">
		<fieldset class="layui-elem-field layui-field-title site-title">
			<legend>
				<a name="fixbar">学员管理</a>
			</legend>
		</fieldset>
		<form class="layui-form white-bg radius" action="save" method="post">
			<input type="hidden" name="limit" value="${param.limit}"> <input
				type="hidden" name="page" value="${param.page}"> <input
				type="hidden" name="id" value="${model.id}">
			<input type="hidden" name="fileuuid" value="${model.fileuuid}" id="fileuuid">
			<input type="hidden" name="group1" value="${model.group1}">
			<input type="hidden" name="performance" value="${model.performance}">
			<input type="hidden" name="points" value="${model.points}">
			<input type="hidden" name="isUsed" value="${model.isUsed}">
			<input type="hidden" name="certificateuuid" value="${model.certificateuuid}">
			<input type="hidden" name="serial" value="${model.serial}">
			<input type="hidden" name="dowNumber" value="${model.dowNumber}">
			<input type="hidden" name="password" value="${model.password}">
			<input type="hidden" name="username" value="${model.username}">
			<input type="hidden" name="type" value="${model.type}">
			<%-- <input type="hidden" name="tbClass.id" value="${model.tbClass.id}"> --%>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">班级</label>
					<div class="layui-input-block">
						<select name="tbClass.id">
							<option value=""></option>
							<c:forEach items="${bjs}" var="bj">
								<option value="${bj.id}"
									${model.tbClass.id==bj.id?'selected':''}>${bj.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">身份证号</label>
					<div class="layui-input-block">
						<input type="text" name="idcode" value="${model.idcode}"
							lay-verify="required" required autocomplete="off"
							placeholder="请输入身份证号" class="layui-input" onclick="tupian()">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">姓名</label>
					<div class="layui-input-block">
						<input type="text" name="name" value="${model.name}"
							lay-verify="required" required autocomplete="off"
							placeholder="请输入姓名" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">性别</label>
					<div class="layui-input-block">
						<select name="sex">
							<option value="男" <c:if test="${model.sex=='男'}">selected</c:if>>男</option>
							<option value="女" <c:if test="${model.sex=='女'}">selected</c:if>>女</option>
						</select>

					</div>
				</div>			
				<div class="layui-inline">
					<label class="layui-form-label">民族</label>
					<div class="layui-input-block">
						<%-- <input type="text" name="nation" value="${model.nation}"
							lay-verify="required" required autocomplete="off"
							placeholder="民族" class="layui-input"> --%>
					<select name = "nation">
						<c:forEach items="${data}" var="data">
							<option value="${data.name}" <c:if test="${fn:contains(model.nation,data.name)}">selected="selected"</c:if>>${data.name}</option>
						</c:forEach>
					</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">政治面貌</label>
					<div class="layui-input-block">
						<%-- <input type="text" name="politics" value="${model.politics}"
							lay-verify="required" required autocomplete="off"
							placeholder="政治面貌" class="layui-input"> --%>
					<select name = "politics">
						<c:forEach items="${data1}" var="data">
							<option value="${data.name}" <c:if test="${fn:contains(model.politics,data.name)}">selected="selected"</c:if>>${data.name}</option>
						</c:forEach>
					</select>
							
					</div>
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">文化程度</label>
					<div class="layui-input-block">
						<%-- <input type="text" name="degree" value="${model.degree}"
							lay-verify="required" required autocomplete="off"
							placeholder="文化程度" class="layui-input"> --%>
					<select name = "degree">
						<c:forEach items="${data2}" var="data">
							<option value="${data.name}" <c:if test="${fn:contains(model.degree,data.name)}">selected="selected"</c:if>>${data.name}</option>
						</c:forEach>
					</select>		
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">开班日期</label>
					<div class="layui-input-block">
						<input type="text" class="layui-input" id="bron" name="bron" value="${model.bron}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">邮箱</label>
					<div class="layui-input-block">
						<input type="text" name="email" value="${model.email}"
							 required autocomplete="off"
							placeholder="邮箱"  class="layui-input">
							
					</div>
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">办公电话</label>
					<div class="layui-input-block">
						<input type="text" name="officetel" value="${model.officetel}"
							 required autocomplete="off"
							placeholder="办公电话"  class="layui-input">
							
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">现任职务</label>
					<div class="layui-input-block">
						<input type="text" name="job" value="${model.job}"
							 required autocomplete="off"
							placeholder="现任职务"  class="layui-input">
							
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">职级</label>
					<div class="layui-input-block">
						<input type="text" name="jobLevel" value="${model.jobLevel}"
							 required autocomplete="off"
							placeholder="职级" class="layui-input">
							
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">邮政编码</label>
					<div class="layui-input-block">
						<input type="text" name="postalCode" value="${model.postalCode}"
							 required autocomplete="off"
							placeholder="邮政编码"  class="layui-input">
							
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">专业技术职称</label>
					<div class="layui-input-block">
						<input type="text" name="speciality" value="${model.speciality}"
							 required autocomplete="off"
							placeholder="专业技术职称" class="layui-input">
							
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">组号</label>
					<div class="layui-input-block">
						<input type="text" name="groupNumber" value="${model.groupNumber}"
							 required autocomplete="off"
							placeholder="组号" class="layui-input">
							
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">座位号</label>
					<div class="layui-input-block">
						<input type="text" name="siteNumber" value="${model.siteNumber}"
							 required autocomplete="off"
							placeholder="座位号" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">车牌号</label>
					<div class="layui-input-block">
						<input type="text" name="carnumber" value="${model.carnumber}"
							 required autocomplete="off"
							placeholder="车牌号" class="layui-input">
							
					</div>
					
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">地址</label>
					<div class="layui-input-block">
						<input type="text" name="address" value="${model.address}"
							autocomplete="off" placeholder="请输入地址" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">电话号码</label>
					<div class="layui-input-block">
						<input type="text" name="phone" value="${model.phone}"
							autocomplete="off" placeholder="请输入电话号码" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">工作单位</label>
					<div class="layui-input-block">
						<input type="text" name="workUnit" value="${model.workUnit}"
							autocomplete="off" placeholder="请输入工作单位" class="layui-input">
					</div>
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">照片</label>
					<div class="layui-input-block" id="layuiUp">
						<div class="layui-upload-drag" id="fileuuidhtmlup">
							<c:if test="${model.fileuuid==null }">
								<i class="layui-icon">&#xe67c;</i>
								<p>点击上传，或将文件拖拽到此处</p>
							</c:if>
							<c:if test="${model.fileuuid!=null }">
								<img alt="" src="download?uuid=${model.fileuuid }" width="100px" height="100px" title="点击重新选择">
							</c:if>
							
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		form = layui.form;
		form.render('select');
		layui.use('laydate', function(){
			var laydate = layui.laydate;
			
			laydate.render({
				elem: '#bron',
			});
		});
	</script>

	<script>
    layui.use('upload', function(){
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#fileuuidhtmlup' //绑定元素
            ,url: 'toFilesave' //上传接口
            ,done: function(res){
                if(res.success){
                	$("#fileuuid").val(res.msg);
                	$("#fileuuidhtmlup").html('<img alt="" src="download?uuid='+res.msg+'" width="100px" height="100px" title="点击重新选择">' );
                }else{
                	layer.open({
                		title: '上传失败'
                		,content: res.msg
                		,time: 2000
                	});   
                }
            }
            ,error: function(){
                
            }
        });
    });
</script>
	
</body>
</html>